/*
 * ToolsTabPanel.java
 *
 * Created on 2010-12-23
 */

package com.feng.swing.tools.ui;

import javax.swing.JButton;
import javax.swing.JPanel;

import com.feng.swing.tools.listener.ToolsTabPanelListener;

/**
 *
 * @author  liubingzhao
 */
public class ToolsTabPanel extends javax.swing.JPanel {

	private static final long serialVersionUID = -4942041675881638439L;
	private static final String AMS_CHARACTER_SET_UTF8 = "UTF-8";
	/** Creates new form ToolsTabPanel */
	public ToolsTabPanel() {
		initComponents();
	}

	/** This method is called from within the constructor to
	 * initialize the form.
	 * WARNING: Do NOT modify this code. The content of this method is
	 * always regenerated by the Form Editor.
	 */
	//GEN-BEGIN:initComponents
	// <editor-fold defaultstate="collapsed" desc="Generated Code">
	private void initComponents() {

		jTabbedPane1 = new javax.swing.JTabbedPane();
		jPanelToSign = new javax.swing.JPanel();
		jLabel1 = new javax.swing.JLabel();
		jScrollPane3 = new javax.swing.JScrollPane();
		toSignData = new javax.swing.JTextArea();
		jLabel3 = new javax.swing.JLabel();
		jScrollPane2 = new javax.swing.JScrollPane();
		toSignPrivateKey = new javax.swing.JTextArea();
		jLabel4 = new javax.swing.JLabel();
		jScrollPane5 = new javax.swing.JScrollPane();
		toSignResult = new javax.swing.JTextArea();
		toSignBtn = new JButton();
		jPanelCheckSign = new javax.swing.JPanel();
		jLabel8 = new javax.swing.JLabel();
		jScrollPane7 = new javax.swing.JScrollPane();
		toCheckData = new javax.swing.JTextArea();
		jLabel9 = new javax.swing.JLabel();
		jScrollPane8 = new javax.swing.JScrollPane();
		toCheckSign = new javax.swing.JTextArea();
		jButton1 = new javax.swing.JButton();
		jLabel11 = new javax.swing.JLabel();
		jScrollPane10 = new javax.swing.JScrollPane();
		checkSingResult = new javax.swing.JTextArea();
		jLabel2 = new javax.swing.JLabel();
		jScrollPane1 = new javax.swing.JScrollPane();
		checkSignPublicKey = new javax.swing.JTextArea();
		jPanelBase64 = new javax.swing.JPanel();
		urlEncodePanel = new UrlEncodePanel();
		jLabel5 = new javax.swing.JLabel();
		jScrollPane4 = new javax.swing.JScrollPane();
		base64Data = new javax.swing.JTextArea();
		jLabel6 = new javax.swing.JLabel();
		base64EncodeBtn = new JButton();
		base64DecodeBtn = new JButton();
		jLabel7 = new javax.swing.JLabel();
		jScrollPane6 = new javax.swing.JScrollPane();
		base64Result = new javax.swing.JTextArea();
		base64CharSet = new javax.swing.JComboBox();

		jLabel1.setText("\u6570\u636e\uff1a");

		jScrollPane3
				.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);

		toSignData.setColumns(20);
		toSignData.setLineWrap(true);
		toSignData.setRows(5);
		jScrollPane3.setViewportView(toSignData);

		jLabel3.setText("\u79c1\u94a5\uff1a");

		jScrollPane2
				.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);

		toSignPrivateKey.setColumns(20);
		toSignPrivateKey.setLineWrap(true);
		toSignPrivateKey.setRows(5);
		jScrollPane2.setViewportView(toSignPrivateKey);

		jLabel4.setText("\u7ed3\u679c\uff1a");

		jScrollPane5
				.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);

		toSignResult.setColumns(20);
		toSignResult.setLineWrap(true);
		toSignResult.setRows(5);
		jScrollPane5.setViewportView(toSignResult);

		toSignBtn.setActionCommand("button1");
		toSignBtn.setLabel("\u751f\u6210\u7b7e\u540d");
		toSignBtn.setName("toSignBtn");
		toSignBtn.addMouseListener(new ToolsTabPanelListener(this));

		org.jdesktop.layout.GroupLayout jPanelToSignLayout = new org.jdesktop.layout.GroupLayout(
				jPanelToSign);
		jPanelToSign.setLayout(jPanelToSignLayout);
		jPanelToSignLayout
				.setHorizontalGroup(jPanelToSignLayout
						.createParallelGroup(
								org.jdesktop.layout.GroupLayout.LEADING)
						.add(
								jPanelToSignLayout
										.createSequentialGroup()
										.addContainerGap()
										.add(
												jPanelToSignLayout
														.createParallelGroup(
																org.jdesktop.layout.GroupLayout.LEADING)
														.add(
																org.jdesktop.layout.GroupLayout.TRAILING,
																jPanelToSignLayout
																		.createSequentialGroup()
																		.add(
																				jPanelToSignLayout
																						.createParallelGroup(
																								org.jdesktop.layout.GroupLayout.LEADING)
																						.add(
																								jLabel3)
																						.add(
																								jLabel4))
																		.addPreferredGap(
																				org.jdesktop.layout.LayoutStyle.RELATED)
																		.add(
																				jPanelToSignLayout
																						.createParallelGroup(
																								org.jdesktop.layout.GroupLayout.LEADING)
																						.add(
																								jScrollPane3,
																								org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
																								349,
																								Short.MAX_VALUE)
																						.add(
																								jScrollPane2,
																								org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
																								349,
																								Short.MAX_VALUE)
																						.add(
																								jScrollPane5,
																								org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
																								349,
																								Short.MAX_VALUE))
																		.addContainerGap())
														.add(
																org.jdesktop.layout.GroupLayout.TRAILING,
																jPanelToSignLayout
																		.createSequentialGroup()
																		.add(
																				toSignBtn,
																				org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
																				org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
																				org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
																		.add(
																				245,
																				245,
																				245))))
						.add(
								jPanelToSignLayout
										.createParallelGroup(
												org.jdesktop.layout.GroupLayout.LEADING)
										.add(
												jPanelToSignLayout
														.createSequentialGroup()
														.addContainerGap()
														.add(jLabel1)
														.addContainerGap(536,
																Short.MAX_VALUE))));
		jPanelToSignLayout
				.setVerticalGroup(jPanelToSignLayout
						.createParallelGroup(
								org.jdesktop.layout.GroupLayout.LEADING)
						.add(
								org.jdesktop.layout.GroupLayout.TRAILING,
								jPanelToSignLayout
										.createSequentialGroup()
										.add(11, 11, 11)
										.add(
												jScrollPane3,
												org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
												76, Short.MAX_VALUE)
										.addPreferredGap(
												org.jdesktop.layout.LayoutStyle.UNRELATED)
										.add(
												jPanelToSignLayout
														.createParallelGroup(
																org.jdesktop.layout.GroupLayout.LEADING)
														.add(jLabel3)
														.add(
																jScrollPane2,
																org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
																77,
																Short.MAX_VALUE))
										.addPreferredGap(
												org.jdesktop.layout.LayoutStyle.UNRELATED)
										.add(
												jPanelToSignLayout
														.createParallelGroup(
																org.jdesktop.layout.GroupLayout.LEADING)
														.add(jLabel4)
														.add(
																jScrollPane5,
																org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
																98,
																org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
										.add(31, 31, 31)
										.add(
												toSignBtn,
												org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
												org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
												org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
										.add(39, 39, 39))
						.add(
								jPanelToSignLayout
										.createParallelGroup(
												org.jdesktop.layout.GroupLayout.LEADING)
										.add(
												jPanelToSignLayout
														.createSequentialGroup()
														.addContainerGap().add(
																jLabel1).add(
																353, 353, 353))));

		jTabbedPane1.addTab("\u751f\u6210\u7b7e\u540d", jPanelToSign);

		jLabel8.setText("\u6570\u636e\uff1a");

		toCheckData.setColumns(20);
		toCheckData.setLineWrap(true);
		toCheckData.setRows(5);
		jScrollPane7.setViewportView(toCheckData);

		jLabel9.setText("\u7b7e\u540d\uff1a");

		toCheckSign.setColumns(20);
		toCheckSign.setLineWrap(true);
		toCheckSign.setRows(5);
		jScrollPane8.setViewportView(toCheckSign);

		jButton1.setText("\u9a8c\u8bc1");
		jButton1.setName("jButton1");
		jButton1.addMouseListener(new ToolsTabPanelListener(this));

		jLabel11.setText("\u7ed3\u679c\uff1a");

		checkSingResult.setColumns(20);
		checkSingResult.setLineWrap(true);
		checkSingResult.setRows(5);
		jScrollPane10.setViewportView(checkSingResult);

		jLabel2.setText("\u516c\u94a5\uff1a");

		checkSignPublicKey.setColumns(20);
		checkSignPublicKey.setLineWrap(true);
		checkSignPublicKey.setRows(5);
		jScrollPane1.setViewportView(checkSignPublicKey);

		org.jdesktop.layout.GroupLayout jPanelCheckSignLayout = new org.jdesktop.layout.GroupLayout(
				jPanelCheckSign);
		jPanelCheckSign.setLayout(jPanelCheckSignLayout);
		jPanelCheckSignLayout
				.setHorizontalGroup(jPanelCheckSignLayout
						.createParallelGroup(
								org.jdesktop.layout.GroupLayout.LEADING)
						.add(
								jPanelCheckSignLayout
										.createSequentialGroup()
										.add(
												jPanelCheckSignLayout
														.createParallelGroup(
																org.jdesktop.layout.GroupLayout.LEADING)
														.add(
																jPanelCheckSignLayout
																		.createSequentialGroup()
																		.addContainerGap()
																		.add(
																				jPanelCheckSignLayout
																						.createParallelGroup(
																								org.jdesktop.layout.GroupLayout.LEADING)
																						.add(
																								jPanelCheckSignLayout
																										.createParallelGroup(
																												org.jdesktop.layout.GroupLayout.CENTER)
																										.add(
																												jLabel8)
																										.add(
																												jLabel9)
																										.add(
																												jLabel2))
																						.add(
																								jLabel11))
																		.add(
																				jPanelCheckSignLayout
																						.createParallelGroup(
																								org.jdesktop.layout.GroupLayout.LEADING)
																						.add(
																								jPanelCheckSignLayout
																										.createSequentialGroup()
																										.add(
																												18,
																												18,
																												18)
																										.add(
																												jPanelCheckSignLayout
																														.createParallelGroup(
																																org.jdesktop.layout.GroupLayout.CENTER)
																														.add(
																																jScrollPane7,
																																org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
																																335,
																																Short.MAX_VALUE)
																														.add(
																																jScrollPane8,
																																org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
																																335,
																																Short.MAX_VALUE)
																														.add(
																																jScrollPane1,
																																org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
																																335,
																																Short.MAX_VALUE)))
																						.add(
																								jPanelCheckSignLayout
																										.createSequentialGroup()
																										.add(
																												18,
																												18,
																												18)
																										.add(
																												jScrollPane10,
																												org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
																												335,
																												Short.MAX_VALUE))))
														.add(
																jPanelCheckSignLayout
																		.createSequentialGroup()
																		.add(
																				229,
																				229,
																				229)
																		.add(
																				jButton1)))
										.addContainerGap()));
		jPanelCheckSignLayout
				.setVerticalGroup(jPanelCheckSignLayout
						.createParallelGroup(
								org.jdesktop.layout.GroupLayout.LEADING)
						.add(
								jPanelCheckSignLayout
										.createSequentialGroup()
										.addContainerGap()
										.add(
												jPanelCheckSignLayout
														.createParallelGroup(
																org.jdesktop.layout.GroupLayout.LEADING)
														.add(
																jScrollPane7,
																org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
																54,
																org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
														.add(jLabel8))
										.add(7, 7, 7)
										.add(
												jPanelCheckSignLayout
														.createParallelGroup(
																org.jdesktop.layout.GroupLayout.LEADING)
														.add(jLabel9)
														.add(
																jScrollPane8,
																org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
																56,
																org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
										.addPreferredGap(
												org.jdesktop.layout.LayoutStyle.RELATED)
										.add(
												jPanelCheckSignLayout
														.createParallelGroup(
																org.jdesktop.layout.GroupLayout.LEADING)
														.add(jLabel2)
														.add(
																jScrollPane1,
																org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
																47,
																org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
										.addPreferredGap(
												org.jdesktop.layout.LayoutStyle.RELATED)
										.add(
												jPanelCheckSignLayout
														.createParallelGroup(
																org.jdesktop.layout.GroupLayout.LEADING)
														.add(
																jPanelCheckSignLayout
																		.createSequentialGroup()
																		.add(
																				jScrollPane10,
																				org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
																				63,
																				org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
																		.add(
																				32,
																				32,
																				32)
																		.add(
																				jButton1))
														.add(jLabel11))
										.addContainerGap(74, Short.MAX_VALUE)));

		jTabbedPane1.addTab("\u7b7e\u540d\u9a8c\u8bc1", jPanelCheckSign);

		jLabel5.setText("\u6570\u636e\uff1a");

		jScrollPane4
				.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);

		base64Data.setColumns(20);
		base64Data.setLineWrap(true);
		base64Data.setRows(5);
		jScrollPane4.setViewportView(base64Data);

		jLabel6.setText("\u7ed3\u679c\uff1a");

		base64EncodeBtn.setLabel("Encode");
		base64EncodeBtn.setName("base64EncodeBtn");
		base64EncodeBtn.addMouseListener(new ToolsTabPanelListener(this));

		base64DecodeBtn.setLabel("Decode");
		base64DecodeBtn.setName("base64DecodeBtn");
		base64DecodeBtn.addMouseListener(new ToolsTabPanelListener(this));
		

		jLabel7.setText("\u5b57\u7b26\u96c6\uff1a");

		base64Result.setColumns(20);
		base64Result.setLineWrap(true);
		base64Result.setRows(5);
		jScrollPane6.setViewportView(base64Result);

		base64CharSet.setModel(new javax.swing.DefaultComboBoxModel(
				new String[] { "UTF-8", "GBK", "ISO-8859-1" }));

		org.jdesktop.layout.GroupLayout jPanelBase64Layout = new org.jdesktop.layout.GroupLayout(
				jPanelBase64);
		
		jPanelBase64.setLayout(jPanelBase64Layout);
		jPanelBase64Layout
				.setHorizontalGroup(jPanelBase64Layout
						.createParallelGroup(
								org.jdesktop.layout.GroupLayout.LEADING)
						.add(
								jPanelBase64Layout
										.createSequentialGroup()
										.addContainerGap()
										.add(
												jPanelBase64Layout
														.createParallelGroup(
																org.jdesktop.layout.GroupLayout.CENTER)
														.add(jLabel7).add(
																jLabel5).add(
																jLabel6))
										.add(
												jPanelBase64Layout
														.createParallelGroup(
																org.jdesktop.layout.GroupLayout.LEADING)
														.add(
																base64CharSet,
																org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
																147,
																org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
														.add(
																jScrollPane4,
																org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
																341,
																Short.MAX_VALUE)
														.add(
																jScrollPane6,
																org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
																341,
																Short.MAX_VALUE))
										.addContainerGap(
												org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
												Short.MAX_VALUE))
						.add(
								jPanelBase64Layout
										.createSequentialGroup()
										.add(136, 136, 136)
										.add(
												base64EncodeBtn,
												org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
												org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
												org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
										.add(146, 146, 146)
										.add(
												base64DecodeBtn,
												org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
												org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
												org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
										.addContainerGap(
												org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
												Short.MAX_VALUE)));
		jPanelBase64Layout
				.setVerticalGroup(jPanelBase64Layout
						.createParallelGroup(
								org.jdesktop.layout.GroupLayout.LEADING)
						.add(
								org.jdesktop.layout.GroupLayout.TRAILING,
								jPanelBase64Layout
										.createSequentialGroup()
										.add(14, 14, 14)
										.add(
												jPanelBase64Layout
														.createParallelGroup(
																org.jdesktop.layout.GroupLayout.LEADING)
														.add(jLabel7)
														.add(
																base64CharSet,
																org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
																org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
																org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
										.addPreferredGap(
												org.jdesktop.layout.LayoutStyle.RELATED)
										.add(
												jPanelBase64Layout
														.createParallelGroup(
																org.jdesktop.layout.GroupLayout.LEADING)
														.add(jLabel5)
														.add(
																jScrollPane4,
																org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
																68,
																Short.MAX_VALUE))
										.addPreferredGap(
												org.jdesktop.layout.LayoutStyle.RELATED)
										.add(
												jPanelBase64Layout
														.createParallelGroup(
																org.jdesktop.layout.GroupLayout.LEADING)
														.add(jLabel6)
														.add(
																jScrollPane6,
																org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
																117,
																org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
										.add(25, 25, 25)
										.add(
												jPanelBase64Layout
														.createParallelGroup(
																org.jdesktop.layout.GroupLayout.TRAILING)
														.add(
																base64EncodeBtn,
																org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
																org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
																org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
														.add(
																base64DecodeBtn,
																org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
																org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
																org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
										.add(93, 93, 93)));

		jTabbedPane1.addTab("Base64", jPanelBase64);
		jTabbedPane1.addTab("UrlEncode", urlEncodePanel);
		
		//jTabbedPane1.addTab("UrlEncode", new UrlEncodePanel());
		org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(
				this);
		this.setLayout(layout);
		layout.setHorizontalGroup(layout.createParallelGroup(
				org.jdesktop.layout.GroupLayout.LEADING).add(0, 434,
				Short.MAX_VALUE).add(
				layout.createSequentialGroup().addContainerGap().add(
						jTabbedPane1,
						org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 414,
						Short.MAX_VALUE).addContainerGap()));
		layout.setVerticalGroup(layout.createParallelGroup(
				org.jdesktop.layout.GroupLayout.LEADING).add(0, 417,
				Short.MAX_VALUE).add(
				layout.createSequentialGroup().add(jTabbedPane1,
						org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 407,
						org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
						.addContainerGap(
								org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
								Short.MAX_VALUE)));
	}// </editor-fold>
	//GEN-END:initComponents
	private void exitMenuItemActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_exitMenuItemActionPerformed
		System.exit(0);
	}// GEN-LAST:event_exitMenuItemActionPerformed

	//GEN-BEGIN:variables
	// Variables declaration - do not modify
	public javax.swing.JComboBox base64CharSet;
	public javax.swing.JTextArea base64Data;
	public JButton base64DecodeBtn;
	public JButton base64EncodeBtn;
	public javax.swing.JTextArea base64Result;
	public javax.swing.JTextArea checkSignPublicKey;
	public javax.swing.JTextArea checkSingResult;
	public javax.swing.JButton jButton1;
	public javax.swing.JLabel jLabel1;
	public javax.swing.JLabel jLabel11;
	public javax.swing.JLabel jLabel2;
	public javax.swing.JLabel jLabel3;
	public javax.swing.JLabel jLabel4;
	public javax.swing.JLabel jLabel5;
	public javax.swing.JLabel jLabel6;
	public javax.swing.JLabel jLabel7;
	public javax.swing.JLabel jLabel8;
	public javax.swing.JLabel jLabel9;
	public javax.swing.JPanel jPanelBase64;
	public javax.swing.JPanel jPanelCheckSign;
	public javax.swing.JPanel jPanelToSign;
	public JPanel urlEncodePanel;
	public javax.swing.JScrollPane jScrollPane1;
	public javax.swing.JScrollPane jScrollPane10;
	public javax.swing.JScrollPane jScrollPane2;
	public javax.swing.JScrollPane jScrollPane3;
	public javax.swing.JScrollPane jScrollPane4;
	public javax.swing.JScrollPane jScrollPane5;
	public javax.swing.JScrollPane jScrollPane6;
	public javax.swing.JScrollPane jScrollPane7;
	public javax.swing.JScrollPane jScrollPane8;
	public javax.swing.JTabbedPane jTabbedPane1;
	public javax.swing.JTextArea toCheckData;
	public javax.swing.JTextArea toCheckSign;
	public JButton toSignBtn;
	public javax.swing.JTextArea toSignData;
	public javax.swing.JTextArea toSignPrivateKey;
	public javax.swing.JTextArea toSignResult;
}